/*
 * @Author: kanglang
 * @Date: 2021-07-26 16:22:06
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-08-10 11:09:39
 * @Description: 水印相机
 */
import React, { Component } from 'react';
import { View, requireNativeComponent, UIManager, findNodeHandle, } from 'react-native';
import PropTypes from 'prop-types';

export default class WatermarkCameraView extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <WaterCameraView ref='WaterCamera' {...this.props} />);
  }

  nativeMethod(name, params) {
    UIManager.dispatchViewManagerCommand(
      this.getWatermarkCameraHandle(),
      UIManager.WaterCameraView.Commands[name],
      params == null || params === undefined ? [] : params
    );
  }

  getWatermarkCameraHandle = () => {
    return findNodeHandle(this.refs.WaterCamera);
  };
}

let WaterCameraView = requireNativeComponent('WaterCameraView', {
  waterFinish: PropTypes.func,
  waterFilePath: PropTypes.func,
  ...View.propTypes
});
